package cn.jeeweb.web.modules.sys.service;

import cn.jeeweb.common.http.Response;
import cn.jeeweb.common.mybatis.mvc.service.ICommonService;
import cn.jeeweb.web.modules.sys.entity.User;
import com.baomidou.mybatisplus.plugins.Page;
import org.springframework.validation.BindingResult;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @title: IUserService.java
 * @package cn.jeeweb.web.modules.sys.service
 * @description: 用户
 */
public interface IUserService extends ICommonService<User> {
	/**
	 * 修改密码
	 * 
	 * @param userId
	 * @param newPassword
	 */
	void changePassword(String userId, String newPassword);

	/**
	 * 根据用户名查找用户
	 * 
	 * @param username
	 * @return
	 */
	public User findByUsername(String username);

	/**
	 * 根据Email查找用户
	 * 
	 * @param email
	 * @return
	 */
	User findByEmail(String email);

	/**
	 * 根据Email查找用户
	 * 
	 * @param phone
	 * @return
	 */
	User findByPhone(String phone);
	/**
	 * 根据工号查找用户
	 *
	 * @param code
	 * @return
	 */
	User findByCode(String code);

	/**
	 * 检查密码
	 * @param userId
	 * @param password
	 * @return
	 */
	Boolean checkPassword(String userId, String password);

	Boolean insertUser(User user,HttpServletRequest request);

	Boolean insertOrUpdateUser(User user, HttpServletRequest request);

	Page getListPage(User user);

	boolean insertOrUpdate(String json);

	boolean insert(String json);

	List<User> getUsersByOrgId(String organizationId);

	List<User> getUsersByGroupId(String organizationId);
}
